package test5.lupeng.jf.com.teamdemo.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import test5.lupeng.jf.com.teamdemo.R;
import test5.lupeng.jf.com.teamdemo.activitys.found.FengxiangActivity;
import test5.lupeng.jf.com.teamdemo.activitys.found.NearPeopleActivity;
import test5.lupeng.jf.com.teamdemo.activitys.found.SaoyisaoActivity;

/**
 * 发现
 * Created by C-yx on 2017/7/27.
 */

public class FoundFragment extends Fragment {

    private static final String TAG = "FoundFragment";
    @BindView(R.id.fengxiang)
    LinearLayout fengxiang;
    @BindView(R.id.fujinderen)
    LinearLayout fujinderen;
    @BindView(R.id.saoyisao)
    LinearLayout saoyisao;
    Unbinder unbinder;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.found_fragment, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.fengxiang, R.id.fujinderen,R.id.saoyisao})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.fengxiang:
                Intent intent = new Intent(getActivity(), FengxiangActivity.class);
                startActivity(intent);
                break;
            case R.id.fujinderen:
                Intent intent1 = new Intent(getActivity(), NearPeopleActivity.class);
                startActivity(intent1);
                break;
            case R.id.saoyisao:
                Intent intent2 = new Intent(getActivity(), SaoyisaoActivity.class);
                startActivity(intent2);
                break;
        }
    }

//    @Override
//    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
//        view.findViewById(R.id.saoyisao).setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                IntentIntegrator intentIntegrator = new IntentIntegrator(getActivity());
//                intentIntegrator.initiateScan();
//                // 设置可以保存条形码（二维码）图片
//                intentIntegrator.setBarcodeImageEnabled(true);
//            }
//        });
//    }


}
